今天的筆記我們將介紹如何開啟 Kubernetes Dashboard.
(部分資訊將會遮罩)
get-credentials
--resource-group 15maksrg --name 15makscls 取得叢集的 Credential
PS C:\k8s\dotnet-docker\samples\aspnetapp> az aks get-credentials --resource-group 1
5maksrg --name 15makscls
Merged "15makscls" as current context in C:\Users\?????\.kube\config
(2) 執行命令 az aks browse --resource-group 15maksrg --name 15makscls 開啟dashboard 通道, 預設會連到本機的 tcp 8001
port
PS C:\k8s\dotnet-docker\samples\aspnetapp> az aks browse --resource-group 15maksrg -
-name 15makscls
Merged "15makscls" as current context in C:\Users\?????\AppData\Local\Temp\tmpjpyckz2r
Proxy running on http://127.0.0.1:8001/
Press CTRL+C to close the tunnel...
Forwarding from 127.0.0.1:8001 -> 9090
Forwarding from [::1]:8001 -> 9090
Handling connection for 8001
clusterrolebinding
kubernetes-dashboard -n kube-system --clusterrole=cluster-admin
--serviceaccount=kube-system:kubernetes-dashboard
dashboard-admin
角色給叢集服務帳戶
PS C:\k8s\dotnet-docker\samples\aspnetapp> kubectl create clusterrolebinding kuberne
tes-dashboard -n kube-system --clusterrole=cluster-admin --serviceaccount=kube-syste
m:kubernetes-dashboard
clusterrolebinding.rbac.authorization.k8s.io "kubernetes-dashboard" created
(2) 再次執行命令 az aks browse --resource-group 15maksrg --name 15makscls 開啟 dashboard 通道
PS C:\k8s\dotnet-docker\samples\aspnetapp> az aks browse --resource-group 15maksrg -
-name 15makscls
Merged "15makscls" as current context in C:\Users\?????\AppData\Local\Temp\tmp3coydt09
Proxy running on http://127.0.0.1:8001/
Press CTRL+C to close the tunnel...
Forwarding from 127.0.0.1:8001 -> 9090
Forwarding from [::1]:8001 -> 9090
Handling connection for 8001
Handling connection for 8001
Handling connection for 8001